#ifndef WOLF_DEBUG_HANDLER_HPP
#define WOLF_DEBUG_HANDLER_HPP

#include "common.hpp"
#include "Manager.hpp"
#include "StdFont.hpp"

namespace wolf
{
/**
 * @brief Interface to execute debug functions.
 * @ingroup engineMod
 *
 * It manages special commands on debug mode. @todo create special command line inside this
 **/
class WOLF_DECLSPEC DebugManager: public Manager
{
public:
	/**
	 * @brief Instantiates a new DebugHandler
	 *
	 *
	 **/
	DebugManager(void);
	~DebugManager(void);

	/**
	 * @brief Gets the current debug handler or null if it has not it
	 *
	 *
	 **/
	static DebugManager *get(void);

	/**
	 * @brief Get showFPS
	 *
	 *
	 **/
	bool isShowingFPS(void) const;
	/**
	 * @brief Sets showFPS
	 *
	 *
	 **/
	void setShowingFPS(bool value);

	/**
	 * @brief Returns the exit key
	 *
	 * the default is SDLK_ESCAPE
	 **/
	SDLKey getExitKey(void) const;

	/**
	 * @brief set the exit key
	 *
	 * SDLK_UNKNOWN turns off the auto exiting by a keypress.
	 **/
	void setExitKey(SDLKey key);

	/**
	 * @brief To indentity when the exitKey is pressed
	 *
	 *
	 **/
	bool onEvent(Engine &engine, SDL_Event &event);

	/**
	 * @brief To draw the fps if needed
	 *
	 *
	 **/
	void onDraw(Engine &engine, SDL_Surface *dst);

private:
	static DebugManager *instance;
	bool showingFPS;
	SDLKey exitKey;
	StdFont font;
	unsigned lastTick;
};

}

#endif // WOLF_DEBUG_HANDLER_HPP
